<template>
<div class="list">
  <list-header :title="title"></list-header>
  <div class="banner">
    <img src="http://img1.qunarzz.com/piao/fusion/1809/20/e971ee0e22822602.jpg_640x361_94b72195.jpg" />
  </div>
  <home-like :list = "likeList"></home-like>
  <home-where :list = "whereList"></home-where>
</div>
</template>

<script>
import listHeader from './components/header'
import homeLike from '@/pages/home/components/like'
import homeWhere from '@/pages/home/components/where'
import axios from 'axios'
export default {
  data () {
    return {
      likeList: [],
      whereList: [],
      title: '景点详情'
    }
  },
  components: {
    listHeader,
    homeLike,
    homeWhere
  },
  mounted () {
    this.getInfo()
  },
  activated () {
    let title = this.$route.params.title
    if (title) {
      this.title = this.$route.params.title
    }
  },
  methods: {
    getInfo () {
      axios.get('/api/index.json').then(this.getInfoSucc)
    },
    getInfoSucc (res) {
      res = res.data
      if (res.ret && res.data) {
        const data = res.data
        this.likeList = data.likeList
        this.whereList = data.whereList
      }
    }
  }
}
</script>

<style scoped>
.banner img{ width:100%;}
h2{font-size: .6rem; text-align: center; padding: .4rem;}
</style>
